boolean

<?
/* bool */ $b = true;
?>
true    : <?= true ? "true" : "false" ?> 
false   : <?= false ? "true" : "false" ?> 
b       : <?= $b ? "true" : "false" ?> 
!true   : <?= ! true ? "true" : "false" ?> 
! true  : <?= ! true ? "true" : "false" ?> 
!! true : <?= ! ! true ? "true" : "false" ?> 
!!! b   : <?= ! ! ! $b ? "true" : "false" ?> 

1 < 2   : <?= 1 < 2 ? "true" : "false" ?> 
1 <= 2  : <?= 1 <= 2 ? "true" : "false" ?> 
1 > 2   : <?= 1 > 2 ? "true" : "false" ?> 
1 >= 2  : <?= 1 >= 2 ? "true" : "false" ?> 

1 < 1.2          : <?= 1 < 1.2 ? "true" : "false" ?> 
1 < 1 + .2       : <?= 1 < 1 + 0.2 ? "true" : "false" ?> 
-1 * -3 < 1 + .2 : <?= -1 * -3 < 1 + 0.2 ? "true" : "false" ?> 

1 == 2  : <?= 1 == 2 ? "true" : "false" ?> 
1 != 2  : <?= 1 != 2 ? "true" : "false" ?> 

1 == 2 == true         : <?= ( 1 == 2 ) == true ? "true" : "false" ?> 
1 == 2 == false        : <?= ( 1 == 2 ) == false ? "true" : "false" ?> 
1 == 2 != true         : <?= ( 1 == 2 ) != true ? "true" : "false" ?> 
1 == 2 != false        : <?= ( 1 == 2 ) != false ? "true" : "false" ?> 
true == 1 < 2          : <?= true == ( 1 < 2 ) ? "true" : "false" ?> 
false == 1 < 2         : <?= false == ( 1 < 2 ) ? "true" : "false" ?> 
true != 1 < 2          : <?= true != ( 1 < 2 ) ? "true" : "false" ?> 
false != 1 < 2         : <?= false != ( 1 < 2 ) ? "true" : "false" ?> 
2 < 3 == 4 < 5         : <?= ( 2 < 3 ) == ( 4 < 5 ) ? "true" : "false" ?> 
-2 < -3 != -4 > -5     : <?= ( -2 < -3 ) != ( -4 > -5 ) ? "true" : "false" ?> 
1 == 2 != true == true : <?= ( ( 1 == 2 ) != true ) == true ? "true" : "false" ?> 

true & false          : <?= (bool) ( true & false ) ? "true" : "false" ?> 
true | false          : <?= (bool) ( true | false ) ? "true" : "false" ?> 
true & true & false   : <?= (bool) ( (bool) ( true & true ) & false ) ? "true" : "false" ?> 
true | true & false   : <?= (bool) ( true | (bool) ( true & false ) ) ? "true" : "false" ?> 
true & true | false   : <?= (bool) ( (bool) ( true & true ) | false ) ? "true" : "false" ?> 
true | true | false   : <?= (bool) ( (bool) ( true | true ) | false ) ? "true" : "false" ?> 
true & ! false & true : <?= (bool) ( (bool) ( true & ! false ) & true ) ? "true" : "false" ?> 
true | ! false & true : <?= (bool) ( true | (bool) ( ! false & true ) ) ? "true" : "false" ?> 
true & ! false | true : <?= (bool) ( (bool) ( true & ! false ) | true ) ? "true" : "false" ?> 

<? /* bool b1 */; /* bool b2 */; /* bool b3 */; /* bool b4 */; ?> 
b1 = true              : <?= ( $b1 = true ) ? "true" : "false" ?> 
b2 = b3 = true         : <?= ( $b2 = $b3 = true ) ? "true" : "false" ?> 
b2                     : <?= $b2 ? "true" : "false" ?> 
b3                     : <?= $b3 ? "true" : "false" ?> 
b4 = false             : <?= ( $b4 = false ) ? "true" : "false" ?> 
b4                     : <?= $b4 ? "true" : "false" ?> 
b1 &= true             : <?= ( $b1 &= true ) ? "true" : "false" ?> 
b1 &= b2  = true       : <?= ( $b1 &= $b2 = true ) ? "true" : "false" ?> 
b1  = b2 &= true       : <?= ( $b1 = $b2 &= true ) ? "true" : "false" ?> 
b1 &= b2 &= true       : <?= ( $b1 &= $b2 &= true ) ? "true" : "false" ?> 
b1                     : <?= $b1 ? "true" : "false" ?> 
b2                     : <?= $b2 ? "true" : "false" ?> 
b3                     : <?= $b3 ? "true" : "false" ?> 
b4                     : <?= $b4 ? "true" : "false" ?> 
b1 &= b2 &= b3 &= b4   : <?= ( $b1 &= $b2 &= $b3 &= $b4 ) ? "true" : "false" ?> 
b2 = b3 |= true        : <?= ( $b2 = $b3 |= true ) ? "true" : "false" ?> 
b1 |= b2 |= b3 |= b4   : <?= ( $b1 |= $b2 |= $b3 |= $b4 ) ? "true" : "false" ?> 
b1 |= b2 |= b3 &= b4   : <?= ( $b1 |= $b2 |= $b3 &= $b4 ) ? "true" : "false" ?> 
b1 |= b2 &= b3 &= b4   : <?= ( $b1 |= $b2 &= $b3 &= $b4 ) ? "true" : "false" ?> 
b1 &= b2 &= b3 &= b4   : <?= ( $b1 &= $b2 &= $b3 &= $b4 ) ? "true" : "false" ?> 
b1 ^= b2  = b3 =  !b4  : <?= ( $b1 ^= $b2 = $b3 = ! $b4 ) ? "true" : "false" ?> 
b1                     : <?= $b1 ? "true" : "false" ?> 
b2                     : <?= $b2 ? "true" : "false" ?> 
b3                     : <?= $b3 ? "true" : "false" ?> 
b4                     : <?= $b4 ? "true" : "false" ?> 
b4  = b2  = b3 != b4   : <?= ( $b4 = $b2 = $b3 != $b4 ) ? "true" : "false" ?> 
b2                     : <?= $b2 ? "true" : "false" ?> 
b3                     : <?= $b3 ? "true" : "false" ?> 
b4                     : <?= $b4 ? "true" : "false" ?> 

b3 &= b2 |= b4 |= b2 &= b3  = !b4  : <?= ( $b3 = $b3 & $b2 = $b2 | $b4 |= $b2 &= $b3 = ! $b4 ) ? "true" : "false" ?> 
b2                                 : <?= $b2 ? "true" : "false" ?> 
b3                                 : <?= $b3 ? "true" : "false" ?> 
b4                                 : <?= $b4 ? "true" : "false" ?> 
b2 |= b4 |= b2 &= b3  = !b4        : <?= ( $b2 = $b2 | $b4 |= $b2 &= $b3 = ! $b4 ) ? "true" : "false" ?> 
b2                                 : <?= $b2 ? "true" : "false" ?> 
b3                                 : <?= $b3 ? "true" : "false" ?> 
b4                                 : <?= $b4 ? "true" : "false" ?> 
b1 ^= b2 ^= b3 ^= b4 ^= b1 ^= b2   : <?= ( $b1 = $b1 ^ $b2 ^= $b3 ^= $b4 ^= $b1 ^= $b2 ) ? "true" : "false" ?> 
b1                                 : <?= $b1 ? "true" : "false" ?> 
b2                                 : <?= $b2 ? "true" : "false" ?> 
b3                                 : <?= $b3 ? "true" : "false" ?> 
b4                                 : <?= $b4 ? "true" : "false" ?> 

java.lang.Boolean

Boolean.parseBoolean("true")  : <?= "true" == "true" ? true : false ? "true" : "false" ?> 
Boolean.parseBoolean("false") : <?= "false" == "true" ? true : false ? "true" : "false" ?> 
Boolean.toString(false)       : <?= false ? "true" : "false" ?> 
Boolean.toString(true)        : <?= true ? "true" : "false" ?> 

